/**
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.merak.core.model.settings;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;


/**
 * Copyright © 2010-2012 Merak Computing. All rights reserved.<br><br>
 *
 * Methods and declarations for Settings.
 *
 * @author fmarinho.
 * @version 1.00.00 - Aug 27, 2012 - fmarinho - initial version.
 *
 * @since MerakCore 1.00.00
 */
@XmlRootElement(name = "application")
@XmlAccessorType(XmlAccessType.FIELD)
public class ApplicationXML implements ISettings<ApplicationXML> {

	private String name        = "Unknown";
	private String description = "Unknown";
	private String version     = "00.00.00";

	private Message     message     = new Message();
	private PropertySet propertySet = new PropertySet();
	private Web         web         = new Web();
	private PluginSet   pluginSet   = new PluginSet();

	/**
	 * @return the name
	 * @since v 1.00.00
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * @return the description
	 * @since v 1.00.00
	 */
	public String getDescription() {
		return this.description;
	}

	/**
	 * @return the version
	 * @since v 1.00.00
	 */
	public String getVersion() {
		return this.version;
	}

	/**
	 * @return the message
	 * @since v 1.00.00
	 */
	public Message getMessage() {
		return this.message;
	}

	/**
	 * @return the propertySet
	 * @since v 1.00.00
	 */
	public PropertySet getPropertySet() {
		return this.propertySet;
	}
	/**
	 * @return the web
	 * @since v 1.00.00
	 */
	public Web getWeb() {
		return this.web;
	}
	/**
	 * @return the pluginSet
	 * @since v 1.00.00
	 */
	public PluginSet getPluginSet() {
		return this.pluginSet;
	}

	/* (non-Javadoc)
	 * @see org.merak.core.settings.ISettings#update(org.merak.core.settings.ISettings)
	 */
	@Override
	public void update(ApplicationXML input) {

		this.name        = input.getName();
		this.description = input.getDescription();
		this.version     = input.getVersion();

		this.message.update( input.message );
		this.propertySet.update( input.propertySet );
		this.web.update( input.web );
		this.pluginSet.update( input.pluginSet );

	}

}
